package cn.zsb.zsb.ctrl;

import cn.zsb.zsb.entity.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
//http://localhost:9999/zhuanshenben/hello/wenhao
@RestController//返回json
@RequestMapping("hello")
public class HelloController {
    @GetMapping("/wenhao")
    public String index(){
        return "hello,springboot";
    }
    @RequestMapping("/findSubjects")
    public List<Subject> findSubjects(){
        List<Subject> datas=new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            datas.add(new Subject(i*2L,i*2L,"java"+i,100));
        }
        return datas;
    }
}
